export const getCookie = key => {
    const obj = {}
    const cookie = document.cookie
    const arr = cookie.split(';')
    arr.forEach(item => {
        const objItem = item.split('=')
        const objKey = objItem[0].trim()
        obj[objKey] = objItem[1]
    })
    return obj[key]
}

export const setCookie = (key, val) => {
    document.cookie = `${key}=${val}`
}
